﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CapaPresentacion
{
    public partial class MDIPrincipal : Form
    {
        public static int idVendedor;

        public static MDIPrincipal principal;

        public MDIPrincipal()
        {
            InitializeComponent();
        }

       

        private void MDIPrincipal_Load(object sender, EventArgs e)
        {
            principal = this;
        }

        private void gestiónPedidoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmGenerarPedido fgp = new FrmGenerarPedido();
            fgp.MdiParent = this;
            fgp.Show();
        }

        private void pedidosPorCodigoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmDetalle fd = new FrmDetalle();
            fd.MdiParent = this;
            fd.Show();
        }

        private void pedidosPorFechasToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmConsultaPedido fcp = new FrmConsultaPedido();
            fcp.MdiParent = this;
            fcp.Show();
        }

        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            FrmProductos fp = new FrmProductos();
            fp.MdiParent = this;
            fp.Show();
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            FrmClientes fc = new FrmClientes();
            fc.MdiParent = this;
            fc.Show();
        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            FrmGenerarPedido fgp = new FrmGenerarPedido();
            fgp.MdiParent = this;
            fgp.Show();
        }

        private void clientesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmClientes fc = new FrmClientes();
            fc.MdiParent = this;
            fc.Show();
        }

        private void productosToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmProductos fp = new FrmProductos();
            fp.MdiParent = this;
            fp.Show();
        }

        private void clientesPorNombreToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmConClientes fcc = new FrmConClientes();
            fcc.Show();
        }

        private void MDIPrincipal_FormClosing(object sender, FormClosingEventArgs e)
        {

            if (MessageBox.Show("Está seguro de Cerrar aplicación?", "Atención", 
                MessageBoxButtons.YesNo, MessageBoxIcon.Question)
                == System.Windows.Forms.DialogResult.Yes)
            {
                System.Environment.Exit(0);
            }
            else
            {
                e.Cancel = true;
            }
        }

        private void tsControlDiario_Click(object sender, EventArgs e)
        {
            GestionCaja.FrmControlDiario fcd = new GestionCaja.FrmControlDiario();
            fcd.MdiParent = this;
            fcd.Show();
        }

        private void aperturaCajaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //GestionCaja.FrmAperturaCaja fac = new GestionCaja.FrmAperturaCaja();
            //fac.MdiParent = this;
            //fac.Show();
            GestionCaja.FrmAperturaCaja.DefInstance.MdiParent = this;
            GestionCaja.FrmAperturaCaja.DefInstance.Show();

        }
       
    }
}
